<%@page import="factory.ServiceFactory"%>
<%@page import="domain.Zkl"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";//因为用了服务器端跳转；所以这边要重定向一下path；保证js和css可以正确载入

	List<Zkl> zkls = ServiceFactory.getSerInstance().getAllZkls();
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>折扣</title>
<link rel="shortcut icon" href="common/YI.jpg" />
<link href="common/css/bootstrap.min.css" rel="stylesheet">
<link href="common/css/datepicker3.css" rel="stylesheet">
<link href="common/css/bootstrap-table.css" rel="stylesheet">
<link href="common/css/styles.css" rel="stylesheet">
<link href="common/css/mystyle.css" rel="stylesheet">
<link href="common/css/tips.css" rel="stylesheet">

<!--[if lt IE 9]>
<script src="common/js/html5shiv.js"></script>
<script src="common/js/respond.min.js"></script>
<![endif]-->

</head>

<body>
	<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed"
					data-toggle="collapse" data-target="#sidebar-collapse">
					<span class="sr-only">Toggle navigation</span> <span
						class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="#"><span>YI书屋</span>Admin</a>
			</div>

		</div>
		<!-- /.container-fluid -->
	</nav>

	<div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar">
		<form role="search">
			<div class="form-group">
				<span>&nbsp;</span>
			</div>
		</form>
		<ul class="nav menu">
			<li><a href="home.html"><span
					class="glyphicon glyphicon-list-alt"></span> 收银</a></li>
			<li><a href="charts.html"><span
					class="glyphicon glyphicon-stats"></span> 统计</a></li>
			<li><a href="goods.do"><span
					class="glyphicon glyphicon-pencil"></span> 进货</a></li>
			<li><a href="list.html"><span
					class="glyphicon glyphicon-list"></span> 清单</a></li>
			<li class="active"><a href="zk.do"><span
					class="glyphicon glyphicon-dashboard"></span> 折扣</a></li>
			<li role="presentation" class="divider"></li>
			<li><span>&nbsp;</span></li>
		</ul>
		<div class="attribution">
			Template by <a href="JavaScript:void(0);">lc1416302550@163.com</a>
		</div>
	</div>
	<!--/.sidebar-->

	<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
		<div class="row">
			<ol class="breadcrumb">
				<li><a href="#"><span class="glyphicon glyphicon-home"></span></a></li>
				<li class="active">折扣</li>
			</ol>
		</div>
		<!--/.row-->

		<div class="row">
			<div class="col-lg-12">
				<h1 class="page-header">折扣</h1>
			</div>
		</div>
		<!--/.row-->


		<div class="row">
			<div class="col-lg-12">
				<div class="panel panel-default">
					<div class="panel-heading">
						折扣分类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="zkName" class="myinput myinput1"
							placeholder="折扣名称">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select
							class="form-control mySelector" id="zhekou1">
							<option value="0">〇</option>
							<option value="1">一</option>
							<option value="2">二</option>
							<option value="3">三</option>
							<option value="4">四</option>
							<option value="5">五</option>
							<option value="6">六</option>
							<option value="7">七</option>
							<option value="8">八</option>
							<option value="9" selected="selected">九</option>
						</select>点<select class="form-control mySelector" id="zhekou2">
							<option value="0" selected="selected">〇</option>
							<option value="1">一</option>
							<option value="2">二</option>
							<option value="3">三</option>
							<option value="4">四</option>
							<option value="5">五</option>
							<option value="6">六</option>
							<option value="7">七</option>
							<option value="8">八</option>
							<option value="9">九</option>
						</select>折&nbsp;&nbsp;&nbsp;<input type="button" id="addZkB"
							class="btn btn-primary mybtn" value="添加" /><input
							style="display: none;" type="button" id="changeZkB"
							class="btn btn-primary mybtn" value="修改" /> <input type="hidden" id="hiddenZk"/>
					</div>
					<div class="panel-body" style="border-bottom: 1px solid #eee;">
						<table style="width: 100%;">
							<thead>
								<tr style="width: 100%;">
									<th style="width: 40%;"><div class="th-inner sortable">名称</div>
										<div class="fht-cell"></div></th>
									<th style="width: 20%;"><div class="th-inner sortable">折扣值</div>
										<div class="fht-cell"></div></th>
									<th style="width: 20%;"><div class="th-inner sortable">操作</div>
										<div class="fht-cell"></div></th>
								</tr>
							</thead>
							<tbody id="tBody"
								style="width: 200%; min-height: 200px; display: block;">
								<tr>
									<td>&nbsp;</td>
									<td>&nbsp;</td>
									<td>&nbsp;</td>
								</tr>
								<%
									for (int i = 0, l = zkls.size(); i < l; i++) {
								%>
								<tr class="modifyTr">
									<td class="zktitle" style="width:50%"><%=zkls.get(i).getTitle()%></td>
									<td class="zkz" style="width:25%"><%=(zkls.get(i).getZk()) %></td>
									<td style="width:20%"><input type="hidden" class="hiddenId" value="<%=zkls.get(i).getId() %>"/><pre onclick="editTr(this)" class="editSpan mySpan" title="修改">    </pre></td>
								</tr>
								<%
									}
								%>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
		<!--/.row-->


	</div>
	<!--/.main-->

	<script src="common/js/jquery-1.11.1.min.js"></script>
	<script src="common/js/bootstrap.min.js"></script>
	<script src="common/js/chart.min.js"></script>
	<script src="common/js/easypiechart.js"></script>
	<script src="common/js/bootstrap-datepicker.js"></script>
	<script src="common/js/bootstrap-table.js"></script>
	<script>
		!function($) {
			$(document)
					.on(
							"click",
							"ul.nav li.parent > a > span.icon",
							function() {
								$(this).find('em:first').toggleClass(
										"glyphicon-minus");
							});
			$(".sidebar span.icon").find('em:first').addClass("glyphicon-plus");
		}(window.jQuery);

		$(window).on('resize', function() {
			if ($(window).width() > 768)
				$('#sidebar-collapse').collapse('show')
		})
		$(window).on('resize', function() {
			if ($(window).width() <= 767)
				$('#sidebar-collapse').collapse('hide')
		})
	</script>
	<script src="common/js/tips.js"></script>
	<script src="common/js/zhekou.js"></script>
</body>

</html>